# Generated from OpenQASM2.g4 by ANTLR 4.13.2
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
    from typing import TextIO
else:
    from typing.io import TextIO


def serializedATN():
    return [
        4,0,43,305,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,
        2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,
        13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,
        19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,
        26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,
        32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,
        39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,1,0,1,0,1,0,1,0,1,0,1,0,1,
        0,1,0,1,0,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,3,1,3,1,4,1,4,1,
        5,1,5,1,5,1,6,1,6,1,6,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,
        8,1,8,1,8,1,8,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,11,1,11,1,
        12,1,12,1,12,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,14,1,14,1,15,1,
        15,1,16,1,16,1,16,1,16,1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,18,1,
        18,1,18,1,18,1,18,1,18,1,19,1,19,1,20,1,20,1,20,1,21,1,21,1,22,1,
        22,1,23,1,23,1,24,1,24,1,25,1,25,1,26,1,26,1,27,1,27,1,27,1,28,1,
        28,1,28,1,28,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,30,1,31,1,31,1,
        31,1,31,1,32,1,32,1,32,1,33,1,33,1,33,1,33,1,33,1,34,1,34,1,34,1,
        34,1,34,1,35,1,35,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,37,1,
        37,5,37,233,8,37,10,37,12,37,236,9,37,1,37,1,37,1,38,1,38,5,38,242,
        8,38,10,38,12,38,245,9,38,1,39,4,39,248,8,39,11,39,12,39,249,1,39,
        1,39,5,39,254,8,39,10,39,12,39,257,9,39,1,39,1,39,4,39,261,8,39,
        11,39,12,39,262,3,39,265,8,39,1,39,1,39,3,39,269,8,39,1,39,4,39,
        272,8,39,11,39,12,39,273,3,39,276,8,39,1,40,1,40,5,40,280,8,40,10,
        40,12,40,283,9,40,1,40,3,40,286,8,40,1,41,4,41,289,8,41,11,41,12,
        41,290,1,41,1,41,1,42,1,42,1,42,1,42,5,42,299,8,42,10,42,12,42,302,
        9,42,1,42,1,42,0,0,43,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,
        10,21,11,23,12,25,13,27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,
        21,43,22,45,23,47,24,49,25,51,26,53,27,55,28,57,29,59,30,61,31,63,
        32,65,33,67,34,69,35,71,36,73,37,75,38,77,39,79,40,81,41,83,42,85,
        43,1,0,9,3,0,10,10,13,13,34,34,1,0,97,122,4,0,48,57,65,90,95,95,
        97,122,1,0,48,57,2,0,69,69,101,101,2,0,43,43,45,45,1,0,49,57,3,0,
        9,10,13,13,32,32,2,0,10,10,13,13,317,0,1,1,0,0,0,0,3,1,0,0,0,0,5,
        1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,
        0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,
        0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,
        0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,
        0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,
        0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,
        0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,
        0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,
        0,0,0,1,87,1,0,0,0,3,96,1,0,0,0,5,98,1,0,0,0,7,105,1,0,0,0,9,107,
        1,0,0,0,11,109,1,0,0,0,13,112,1,0,0,0,15,115,1,0,0,0,17,123,1,0,
        0,0,19,131,1,0,0,0,21,136,1,0,0,0,23,138,1,0,0,0,25,140,1,0,0,0,
        27,145,1,0,0,0,29,150,1,0,0,0,31,152,1,0,0,0,33,154,1,0,0,0,35,162,
        1,0,0,0,37,165,1,0,0,0,39,171,1,0,0,0,41,173,1,0,0,0,43,176,1,0,
        0,0,45,178,1,0,0,0,47,180,1,0,0,0,49,182,1,0,0,0,51,184,1,0,0,0,
        53,186,1,0,0,0,55,188,1,0,0,0,57,191,1,0,0,0,59,195,1,0,0,0,61,199,
        1,0,0,0,63,203,1,0,0,0,65,207,1,0,0,0,67,210,1,0,0,0,69,215,1,0,
        0,0,71,220,1,0,0,0,73,225,1,0,0,0,75,230,1,0,0,0,77,239,1,0,0,0,
        79,264,1,0,0,0,81,285,1,0,0,0,83,288,1,0,0,0,85,294,1,0,0,0,87,88,
        5,79,0,0,88,89,5,80,0,0,89,90,5,69,0,0,90,91,5,78,0,0,91,92,5,81,
        0,0,92,93,5,65,0,0,93,94,5,83,0,0,94,95,5,77,0,0,95,2,1,0,0,0,96,
        97,5,59,0,0,97,4,1,0,0,0,98,99,5,111,0,0,99,100,5,112,0,0,100,101,
        5,97,0,0,101,102,5,113,0,0,102,103,5,117,0,0,103,104,5,101,0,0,104,
        6,1,0,0,0,105,106,5,40,0,0,106,8,1,0,0,0,107,108,5,41,0,0,108,10,
        1,0,0,0,109,110,5,105,0,0,110,111,5,102,0,0,111,12,1,0,0,0,112,113,
        5,61,0,0,113,114,5,61,0,0,114,14,1,0,0,0,115,116,5,98,0,0,116,117,
        5,97,0,0,117,118,5,114,0,0,118,119,5,114,0,0,119,120,5,105,0,0,120,
        121,5,101,0,0,121,122,5,114,0,0,122,16,1,0,0,0,123,124,5,105,0,0,
        124,125,5,110,0,0,125,126,5,99,0,0,126,127,5,108,0,0,127,128,5,117,
        0,0,128,129,5,100,0,0,129,130,5,101,0,0,130,18,1,0,0,0,131,132,5,
        113,0,0,132,133,5,114,0,0,133,134,5,101,0,0,134,135,5,103,0,0,135,
        20,1,0,0,0,136,137,5,91,0,0,137,22,1,0,0,0,138,139,5,93,0,0,139,
        24,1,0,0,0,140,141,5,99,0,0,141,142,5,114,0,0,142,143,5,101,0,0,
        143,144,5,103,0,0,144,26,1,0,0,0,145,146,5,103,0,0,146,147,5,97,
        0,0,147,148,5,116,0,0,148,149,5,101,0,0,149,28,1,0,0,0,150,151,5,
        123,0,0,151,30,1,0,0,0,152,153,5,125,0,0,153,32,1,0,0,0,154,155,
        5,109,0,0,155,156,5,101,0,0,156,157,5,97,0,0,157,158,5,115,0,0,158,
        159,5,117,0,0,159,160,5,114,0,0,160,161,5,101,0,0,161,34,1,0,0,0,
        162,163,5,45,0,0,163,164,5,62,0,0,164,36,1,0,0,0,165,166,5,114,0,
        0,166,167,5,101,0,0,167,168,5,115,0,0,168,169,5,101,0,0,169,170,
        5,116,0,0,170,38,1,0,0,0,171,172,5,85,0,0,172,40,1,0,0,0,173,174,
        5,67,0,0,174,175,5,88,0,0,175,42,1,0,0,0,176,177,5,44,0,0,177,44,
        1,0,0,0,178,179,5,43,0,0,179,46,1,0,0,0,180,181,5,45,0,0,181,48,
        1,0,0,0,182,183,5,42,0,0,183,50,1,0,0,0,184,185,5,47,0,0,185,52,
        1,0,0,0,186,187,5,94,0,0,187,54,1,0,0,0,188,189,5,112,0,0,189,190,
        5,105,0,0,190,56,1,0,0,0,191,192,5,115,0,0,192,193,5,105,0,0,193,
        194,5,110,0,0,194,58,1,0,0,0,195,196,5,99,0,0,196,197,5,111,0,0,
        197,198,5,115,0,0,198,60,1,0,0,0,199,200,5,116,0,0,200,201,5,97,
        0,0,201,202,5,110,0,0,202,62,1,0,0,0,203,204,5,101,0,0,204,205,5,
        120,0,0,205,206,5,112,0,0,206,64,1,0,0,0,207,208,5,108,0,0,208,209,
        5,110,0,0,209,66,1,0,0,0,210,211,5,115,0,0,211,212,5,113,0,0,212,
        213,5,114,0,0,213,214,5,116,0,0,214,68,1,0,0,0,215,216,5,97,0,0,
        216,217,5,115,0,0,217,218,5,105,0,0,218,219,5,110,0,0,219,70,1,0,
        0,0,220,221,5,97,0,0,221,222,5,99,0,0,222,223,5,111,0,0,223,224,
        5,115,0,0,224,72,1,0,0,0,225,226,5,97,0,0,226,227,5,116,0,0,227,
        228,5,97,0,0,228,229,5,110,0,0,229,74,1,0,0,0,230,234,5,34,0,0,231,
        233,8,0,0,0,232,231,1,0,0,0,233,236,1,0,0,0,234,232,1,0,0,0,234,
        235,1,0,0,0,235,237,1,0,0,0,236,234,1,0,0,0,237,238,5,34,0,0,238,
        76,1,0,0,0,239,243,7,1,0,0,240,242,7,2,0,0,241,240,1,0,0,0,242,245,
        1,0,0,0,243,241,1,0,0,0,243,244,1,0,0,0,244,78,1,0,0,0,245,243,1,
        0,0,0,246,248,7,3,0,0,247,246,1,0,0,0,248,249,1,0,0,0,249,247,1,
        0,0,0,249,250,1,0,0,0,250,251,1,0,0,0,251,255,5,46,0,0,252,254,7,
        3,0,0,253,252,1,0,0,0,254,257,1,0,0,0,255,253,1,0,0,0,255,256,1,
        0,0,0,256,265,1,0,0,0,257,255,1,0,0,0,258,260,5,46,0,0,259,261,7,
        3,0,0,260,259,1,0,0,0,261,262,1,0,0,0,262,260,1,0,0,0,262,263,1,
        0,0,0,263,265,1,0,0,0,264,247,1,0,0,0,264,258,1,0,0,0,265,275,1,
        0,0,0,266,268,7,4,0,0,267,269,7,5,0,0,268,267,1,0,0,0,268,269,1,
        0,0,0,269,271,1,0,0,0,270,272,7,3,0,0,271,270,1,0,0,0,272,273,1,
        0,0,0,273,271,1,0,0,0,273,274,1,0,0,0,274,276,1,0,0,0,275,266,1,
        0,0,0,275,276,1,0,0,0,276,80,1,0,0,0,277,281,7,6,0,0,278,280,7,3,
        0,0,279,278,1,0,0,0,280,283,1,0,0,0,281,279,1,0,0,0,281,282,1,0,
        0,0,282,286,1,0,0,0,283,281,1,0,0,0,284,286,5,48,0,0,285,277,1,0,
        0,0,285,284,1,0,0,0,286,82,1,0,0,0,287,289,7,7,0,0,288,287,1,0,0,
        0,289,290,1,0,0,0,290,288,1,0,0,0,290,291,1,0,0,0,291,292,1,0,0,
        0,292,293,6,41,0,0,293,84,1,0,0,0,294,295,5,47,0,0,295,296,5,47,
        0,0,296,300,1,0,0,0,297,299,8,8,0,0,298,297,1,0,0,0,299,302,1,0,
        0,0,300,298,1,0,0,0,300,301,1,0,0,0,301,303,1,0,0,0,302,300,1,0,
        0,0,303,304,6,42,0,0,304,86,1,0,0,0,14,0,234,243,249,255,262,264,
        268,273,275,281,285,290,300,1,6,0,0
    ]

class OpenQASM2Lexer(Lexer):

    atn = ATNDeserializer().deserialize(serializedATN())

    decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]

    T__0 = 1
    T__1 = 2
    T__2 = 3
    T__3 = 4
    T__4 = 5
    T__5 = 6
    T__6 = 7
    T__7 = 8
    T__8 = 9
    T__9 = 10
    T__10 = 11
    T__11 = 12
    T__12 = 13
    T__13 = 14
    T__14 = 15
    T__15 = 16
    T__16 = 17
    T__17 = 18
    T__18 = 19
    T__19 = 20
    T__20 = 21
    T__21 = 22
    T__22 = 23
    T__23 = 24
    T__24 = 25
    T__25 = 26
    T__26 = 27
    T__27 = 28
    T__28 = 29
    T__29 = 30
    T__30 = 31
    T__31 = 32
    T__32 = 33
    T__33 = 34
    T__34 = 35
    T__35 = 36
    T__36 = 37
    STRING = 38
    ID = 39
    REAL = 40
    NNINTEGER = 41
    WS = 42
    COMMENT = 43

    channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]

    modeNames = [ "DEFAULT_MODE" ]

    literalNames = [ "<INVALID>",
            "'OPENQASM'", "';'", "'opaque'", "'('", "')'", "'if'", "'=='", 
            "'barrier'", "'include'", "'qreg'", "'['", "']'", "'creg'", 
            "'gate'", "'{'", "'}'", "'measure'", "'->'", "'reset'", "'U'", 
            "'CX'", "','", "'+'", "'-'", "'*'", "'/'", "'^'", "'pi'", "'sin'", 
            "'cos'", "'tan'", "'exp'", "'ln'", "'sqrt'", "'asin'", "'acos'", 
            "'atan'" ]

    symbolicNames = [ "<INVALID>",
            "STRING", "ID", "REAL", "NNINTEGER", "WS", "COMMENT" ]

    ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", 
                  "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", 
                  "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", 
                  "T__20", "T__21", "T__22", "T__23", "T__24", "T__25", 
                  "T__26", "T__27", "T__28", "T__29", "T__30", "T__31", 
                  "T__32", "T__33", "T__34", "T__35", "T__36", "STRING", 
                  "ID", "REAL", "NNINTEGER", "WS", "COMMENT" ]

    grammarFileName = "OpenQASM2.g4"

    def __init__(self, input=None, output:TextIO = sys.stdout):
        super().__init__(input, output)
        self.checkVersion("4.13.2")
        self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
        self._actions = None
        self._predicates = None


